
local SARFFIX2_ARCANE_VORTEX = "Arcane Vortex";
local SARFFIX2_ARCANE_SURGE = "Arcane Surge";

local SARFFIX_ARCANE_VORTEX_GOGGLE = "Ultra-Spectropic Detection Goggles";


function SarfFix2:CheckForArcaneSurgeGain()
	if ( arg1 ) and ( strfind(arg1, SARFFIX2_ARCANE_VORTEX) ) and ( strfind(arg1, SARFFIX2_ARCANE_VORTEX) ) then
		self:ArcaneVortexDetection_Detected();
	end
end

function SarfFix2:ArcaneVortexDetection_Detected()
	SarfFix2:Splash("ARCANE VORTEX DETECTED!");
	if ( self:GetSetting("equipArcaneVortexGoggle") ) and ( not InCombatLockdown() ) then
		EquipItemByName(SARFFIX_ARCANE_VORTEX_GOGGLE);
	end
end

function SarfFix2:ArcaneVortexDetection_Initialize()
	self:AddEventListener("CHAT_MSG_SPELL_PERIODIC_SELF_BUFFS", "CheckForArcaneSurgeGain");
end


SarfFix2:AddInitializer("ArcaneVortexDetection_Initialize");